package com.ethink.order.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.SaleDemandOrderDetailInfo;
import com.ethink.order.api.info.SaleDemandOrderInfo;
import com.ethink.order.api.info.SaleDemandOrderModeInfo;
import com.ethink.order.api.model.PreSuppleOrderDetailModel;
import com.ethink.order.api.request.PreSupplePageQueryRequest;
import com.ethink.order.api.request.SaleDemandOrderQueryModeRequest;
import com.ethink.order.api.request.SaleDemandOrderQueryRequest;
import com.ethink.order.common.entity.SaleDemandOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 销售需求单 Mapper接口
 *
 * @author default
 * @date 2022-10-31
 */
@Mapper
public interface SaleDemandOrderMapper extends BaseMapper<SaleDemandOrder> {

    /**
     * 分页查询
     *
     * @param buildPage
     * @param request
     * @return
     */
    Page<SaleDemandOrderInfo> querySaleDemandOrder(Page buildPage, @Param("request") SaleDemandOrderQueryRequest request);

    /**
     * 详情
     *
     * @param detailOrderNo
     * @return
     */
    List<SaleDemandOrderDetailInfo> getSaleDemandOrderByNo(@Param("orderNo") String detailOrderNo);

    /**
     * 列表查询
     *
     * @param request
     * @return
     */
    List<SaleDemandOrderInfo> listSaleDemandOrder(@Param("request") SaleDemandOrderQueryRequest request);

    Page<PreSuppleOrderDetailModel> pageQueryByPreSupple(Page buildPage, @Param("query") PreSupplePageQueryRequest request);

    /**
     * 货品模式分页查询
     *
     * @param buildPage
     * @param request
     * @return
     */
    Page<SaleDemandOrderModeInfo> querySaleDemandOrderMode(Page buildPage, @Param("request") SaleDemandOrderQueryModeRequest request);

}